<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
	
<%@ include file="/common/commonLib.jsp"%>
<link rel="stylesheet" type="text/css" href="<c:url value='/css/classroomHeader.css'/>" />

<div class="row">
	<div class="col-md-12 col-lg-12 classroom-title" style="background-image: url(<c:url value='/image/classroom-bgimg.png'/>);background-size:100% 100%;repeat:no-repeat;">
		<div class="link-intro">
			<a id="navCourseName" title="返回课程首页"></a>&nbsp;>&nbsp;
			<a id="navClassName" title="返回授课班级页面"></a>&nbsp;>&nbsp;
			<span class="navClassroom" ></span>
		</div>
		<div class="classroom-course-name"></div>
		<div class="classroom-title-info">
			<ul>
				<li>
					<div class="ctitle">上课时间</div>
				</li>
				<li>
					<div class="classroom-time"></div>
				</li>
				<li>
					<div class="ctitle">上课地点</div>
				</li>
				<li>
					<div class="classroom-address"></div>
				</li>
			</ul>
		</div>
	</div>
</div>

<script>

var initLesson = function(lessonId){
	$.get(CONTEXT_PATH+"lesson/ajaxDetailView?id="+lessonId, function(data) {
		if(data.status=="success"){
			$("#navCourseName").text(data.data.lesson.courseName);
			$("#navCourseName").attr("href",CONTEXT_PATH + "task/list?courseId=" + data.data.lesson.courseId);
			$("#navClassName").text(data.data.lesson.className);
			$("#navClassName").attr("href",CONTEXT_PATH + "lesson/listView?id=" + data.data.lesson.classId);
			$(".navClassroom").text(data.data.lesson.beginDate+"-"+data.data.lesson.endDate);
			
			$(".classroom-course-name").text(data.data.lesson.className);
			$(".classroom-time").text(data.data.lesson.beginDate+"-"+data.data.lesson.endDate);
			$(".classroom-address").text(isNull(data.data.lesson.location));
		}else{
			alert(data.message);
		}
	});
}

var isNull = function(string){
	if(string == null || string.trim() == ""){
		return "(无)";
	}else{
		return string.trim();
	}
}

</script>